import request from '@/utils/request'

export default {
  getList(courseId) {
    return request({
      url: `/service_edu/chapter/getChapters/${courseId}`,
      method: 'get'
    })
  },
  addChapter(chapter) {
    return request({
      url: `/service_edu/chapter`,
      method: 'post',
      data: chapter
    })
  },
  deleteChapter(id) {
    return request({
      url: `/service_edu/chapter/${id}`,
      method: 'post',
    })
  },
  getChapter(id) {
    return request({
      url: `/service_edu/chapter/${id}`,
      method: 'get'
    })
  },
  updateChapter(chapter) {
    return request({
      url: `/service_edu/chapter`,
      method: 'put',
      data: chapter
    })
  }
}
